<template>
	<view class="body">
		<view v-if="loading">
			<loading></loading>
		</view>
		<view class="container" v-else>
			<view class="reportView">
				<uni-row class="uni-row">
					<uni-col :span="18">
						<view class="text-item">
							<text class="title">姓名：</text>
							<text class="blue">{{info.studentName}}</text>
						</view>
						<view class="text-item">
							<text class="title">性别：</text>
							<text class="blue">{{info.sex == 0?'男':info.sex == 1?'女':'未知'}}</text>
						</view>
						<view class="text-item">
							<text class="title">民族：</text>
							<text class="blue">{{info.nation}}</text>
						</view>
					</uni-col>
					<uni-col :span="6">
						<view class="image-view">
							<image class="image" :src="info.idPhoto == null || info.idPhoto == ''?'':info.idPhoto" mode=""></image>
						</view>
					</uni-col>
				</uni-row>
				<uni-row class="uni-row">
					<uni-col>
						<view class="text-item">
							<text class="title">年龄：</text>
							<text class="blue">{{info.address}}</text>
						</view>
					</uni-col>
				</uni-row>
				<uni-row class="uni-row">
					<uni-col>
						<view class="text-item">
							<text class="title">身份证号：</text>
							<text class="blue">{{info.idCard}}</text>
						</view>
					</uni-col>
				</uni-row>
				<uni-row class="uni-row">
					<uni-col>
						<view class="text-item">
							<text class="title">学号：</text>
							<text class="blue">{{info.studentNum}}</text>
						</view>
					</uni-col>
				</uni-row>
				<uni-row class="uni-row">
					<uni-col>
						<view class="text-item">
							<text class="title">国籍：</text>
							<text class="blue">{{info.nationality}}</text>
						</view>
					</uni-col>
				</uni-row>
				<uni-row class="uni-row">
					<uni-col>
						<view class="text-item">
							<text class="title">籍贯：</text>
							<text class="blue">{{info.address}}</text>
						</view>
					</uni-col>
				</uni-row>
				<uni-row class="uni-row">
					<uni-col>
						<view class="text-item">
							<text class="title">联系电话：</text>
							<text class="blue">{{info.mobile}}</text>
						</view>
					</uni-col>
				</uni-row>
				<uni-row class="uni-row">
					<uni-col>
						<view class="text-item">
							<text class="title">所属年级：</text>
							<text class="blue">{{info.classId}}</text>
						</view>
					</uni-col>
				</uni-row>
				<uni-row class="uni-row">
					<uni-col>
						<view class="text-item">
							<text class="title">所属班级：</text>
							<text class="blue">{{info.gradeId}}</text>
						</view>
					</uni-col>
				</uni-row>
				<uni-row class="uni-row">
					<uni-col>
						<view class="text-item">
							<text class="title">父亲姓名：</text>
							<text class="blue">{{info.fatherName}}</text>
						</view>
					</uni-col>
				</uni-row>
				<uni-row class="uni-row">
					<uni-col>
						<view class="text-item">
							<text class="title">父亲电话：</text>
							<text class="blue">{{info.fatherPhone}}</text>
						</view>
					</uni-col>
				</uni-row>
				<uni-row class="uni-row">
					<uni-col>
						<view class="text-item">
							<text class="title">母亲姓名：</text>
							<text class="blue">{{info.motherName}}</text>
						</view>
					</uni-col>
				</uni-row>
				<uni-row class="uni-row">
					<uni-col>
						<view class="text-item">
							<text class="title">母亲电话：</text>
							<text class="blue">{{info.motherPhone}}</text>
						</view>
					</uni-col>
				</uni-row>
			</view>
		</view>
	</view>
</template>

<script>
		import { getStudentById, } from '@/api/school/school.js'
		import loading from '@/components/loading/loading'
		export default{
			data(){
				return{
					id:null,
					info:{},
					loading:true,
				}
			},
			onLoad(e) {
				if(e.id != null && e.id != ''){
					this.id = e.id
					this.getData();
				}
			},
			methods:{
				getData(){
					let data={
						id:this.id
					}
					getStudentById(data).then(res=>{
						this.info = res.data
						this.loading = false
					})
				}
			}
			
		}
</script>

<style lang="scss">
	page{
		background-color: #fff;
	}
	.container{
		width: calc(100vw - 40px);
		height: 100vh;
		margin: 0 auto;
		padding-top: 10px;

		.text-item{
			padding-left: 20rpx;
			line-height: 100rpx;
			font-size: 14px;
			font-family: Inter-Regular, Inter;
			color: #000000;
			.blue{
				color: #508CFF;
			}
		}
		.image-view {
			border: 1px solid #999;
			.image{
				width: 170rpx;
				height: 200rpx;
			}
			
		}
	}
</style>